<?php

/**
 * @name: HOTN AnimeList
 * @author: HammerOnTheNail
 * @link: http://code.google.com/p/hotnanimelist/
 */

// Admin oldal címének meghatározása
$title .= " \ ".HOTN_ANIMELIST_ADMIN_MENU_TEAM_CREATE;

// csapat kiválasztása
if ($HOTN_ANIMELIST_OPTIONS['team_group'] <> "254" && $HOTN_ANIMELIST_OPTIONS['team_group'] <> "250" )
{
	$arg = "user_class = '{$HOTN_ANIMELIST_OPTIONS['team_group']}' OR user_class REGEXP('^{$HOTN_ANIMELIST_OPTIONS['team_group']},') OR user_class REGEXP(',{$HOTN_ANIMELIST_OPTIONS['team_group']},') OR user_class REGEXP(',{$HOTN_ANIMELIST_OPTIONS['team_group']}$')";
}
elseif ($HOTN_ANIMELIST_OPTIONS['team_group'] == "254")
{
	$arg = "user_admin = 1";
}
else
{
	$arg = "user_perms = '0' OR user_perms REGEXP('0.') or user_perms REGEXP('^0,') OR user_perms REGEXP(',0,') OR user_perms REGEXP(',0$')";
}

$sql->db_Select('user', 'user_id, user_loginname', $arg);
while($row = $sql->db_Fetch())
{
	$values['team_user'][$row['user_id']] = $row['user_loginname'];
}
asort($values['team_user'],SORT_LOCALE_STRING);

$values['action'] = array("action"=>"create");
$values["team_submit"] = HOTN_ANIMELIST_ADMIN_TEAM_FORUM_SAVE;
$values['form_action'] = e_PLUGIN."hotn_animelist/Admin/team/admin_team_action.php";

// tömb külön file-ban
include(e_PLUGIN."hotn_animelist/Admin/team/array.php");

// Admin oldal tartalmának megjelenítése
$text = "";
$text .= "<div style='text-align: center;'>".$HOTN_ANIMELIST_FORM->show_form($data)."</div>";
?>